package com.self.audiocapture;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;

import com.self.audiocapture.databinding.MainActivity3Binding;

/**
 * @author huang
 */
public class MainActivity3 extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MainActivity3Binding binding = DataBindingUtil.setContentView(this, R.layout.main_activity3);
        binding.start.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startService(new Intent(MainActivity3.this, FloatBarManager.class));
                Toast.makeText(MainActivity3.this, "启动成功", Toast.LENGTH_SHORT).show();
            }
        });

        binding.stop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity3.this, FloatBarManager.class);
                stopService(intent);
            }
        });
    }
}
